package com.whd.demo;

/**
 * @author whd
 * @date 2023/07/25 18:29:36
 */
public class Demo1 {
    public static void main(String[] args) {
        System.out.println(f(14));
    }

    private static int f(int n) {
        if (n < 2) {
            return 0;
        }
        if (n >= 2 && n < 4) {
            return 1;
        }
        int sum = n / 3;
        return sum+f(n-sum*3+sum);
    }
}